package com.surekam.data;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class DBConnection extends SQLiteOpenHelper {
    public static final int VERSION = 2;

    public static final String DATABASE_NAME = "DBContacts";
    public static final String DATABASE_NAME1 = "AddressBook";
	public static final String TABLE_UPDATE = "jiayue";
    
    public DBConnection(Context context){
	this(context, DATABASE_NAME, null, VERSION);
    }
    
    public DBConnection(Context context, String name, CursorFactory factory,
	    int version) {
	super(context, name, factory, version);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
	String _sql = " CREATE TABLE AddressBook (userid text  PRIMARY KEY ,"
		+ "name text NOT NULL,phone text,"
		+ "deptName text,rdeptName text,"
		+ "duty text,spell text)";
//	data/data/com.surekam/AddressBook.db
	String _sql_0 = "Create Table jiayue(id int,time text)";
	
	db.execSQL(_sql);
	db.execSQL(_sql_0);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }

}
